import React, { useEffect, useState } from 'react'
 import axios from 'axios'
 import ItemList from '../components/ItemList'
function List() {

const [list,setList]=useState([])
  const gatdata=async ()=>{
    const res =await axios.get('/api/list')
    console.log(res.data.data);
    setList(res.data.data)
  }
  useEffect(()=>{
    gatdata()
  },[])
  return (
    <div>
      <div>
        {
          list.map((v,i)=>{
            return <ItemList v={v} key={i}></ItemList>
          })
        }
      </div>
    </div>
  )
}

export default List